<script>
	import http from 'api/api.js'
	export default {
		onLaunch: function() {
			uni.login({
				 provider: 'weixin',
				  success: function (res) {
				    http.getToken({code:res.code}).then(res => {
				    	let token = JSON.parse(res.data.data.token);
						try {
						    uni.setStorageSync('sessionKey', token.session_key);
						    uni.setStorageSync('openid', token.openid);
						} catch (e) {
						   
						}
				    })
				  }
			})
		},
		onShow: function() {
			
		},
		onHide: function() {
			
		}
	}
</script>

<style>
	/*每个页面公共css */
	/* @import './common/uni.css'; */
	
	page {
		background-color: #EEEEEE;
		height: 100%;
		font-size: 28upx;
		line-height: 1.8;
		background-color: #EEEEEE;
	}
	view{box-sizing:border-box;}
	.row{display:flex;flex-wrap:wrap;}
	.row-top{align-items:flex-start;}
	.row-middle{align-items:center;}
	.row-bottom{align-items:flex-end;}
	.row-left{justify-content:flex-start;}
	.row-center{justify-content:center;}
	.row-right{justify-content:flex-end;}
	.row-between{justify-content:space-between;}
	.row-around{justify-content:space-around;}
	.row-column{flex-direction:column;}
	.row-column-between{flex-direction:column;justify-content:space-between;}
	.row-column-around{flex-direction:column;justify-content:space-around;}
	.row-center-wrapper{align-items:center;justify-content:center;}
	.row-between-wrapper{align-items:center;justify-content:space-between;}
	.font-color{color:#FEE3AE;}
	.bg-color{background-color:#e93323;}
	.icon-color{color:#ff3c2b;}
	.cart-color{color:#ff3700;border:2upx solid #ff3700;}
	.gray-color{color: #ADADAD;}
	.line1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
	.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
	.bottom-line{border-bottom: 2upx solid #e3e3e3;}
	.mask{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0.5;z-index:5;}
	.img-icon{width: 40upx;height: 40upx;}
</style>
